import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from "vue-router";
import HomeView from "../views/HomeView.vue";

//房屋管理路由导入
import FwglView from "../views/fwgl/FwglView.vue"
import HzglView from "../views/fwgl/HzglView.vue"
import ZzglView from "../views/fwgl/ZzglView.vue"

//用户管理路由
import ManagerIndexView from '@/views/manager/ManagerIndexView.vue'
import ManagerVipView from '@/views/manager/ManagerVipView.vue'
import ManagerNovipView from '../views/manager/ManagerNovipView.vue'
import UserCommentsView from '../views/manager/UserCommentsView.vue'

//数据中心
import DataCenterIndexView from '../views/datacenter/DataCenterIndexView.vue'
import DataCenterShowView from '../views/datacenter/DataCenterShowView.vue'

//订单管理
import  homeOrder  from  "@/views/ordermanager/homeOrder.vue"
import  houseOrder  from  "@/views/ordermanager/houseOrder.vue"
import orderAdministration  from  "@/views/ordermanager/orderAdministration.vue"
import  orderOverview  from  "@/views/ordermanager/orderOverview.vue"
import repairOrder from  "@/views/ordermanager/repairOrder.vue"

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: 'datacenter',
        name: 'datacenter',
        lable:'数据中心' ,
        component: DataCenterIndexView,
        children:[
          {
            path: 'datacentershow',
            name: 'datacentershow',
            lable:'数据展示' ,
            component: DataCenterShowView,
        }
        ]
      },

      // 用户管理
      {
        path: 'manager',
        name: 'manager',
        lable:'用户管理' ,
        component: ManagerIndexView,
        children:[
          {
            path: 'managervip',
            name: 'managervip',
            lable:'会员管理' ,
            component: ManagerVipView,
          },
          {
            path: 'managernovip',
            name: 'managernovip',
            lable:'非会员管理' ,
            component: ManagerNovipView,
          },
          {
            path: 'usercomments',
            name: 'usercomments',
            lable:'用户评论' ,
            component: UserCommentsView,
          }

        ]
      },
      //   订单管理
      {
        path:'ordermanager',
        name:'ordermanager',
        label:'订单管理',
        component:orderAdministration,
        //三级
        children:[
          {
            path:'homeOrder',
            name:'homeOrder',
            label:'家服订单',
            component:homeOrder
          },
          {
            path:'houseOrder',
            name:'houseOrder',
            label:'房屋订单',
            component:houseOrder
          },
          {
            path:'repairOrder',
            name:'repairOrder',
            label:' 维修订单',
            component:repairOrder
          },
          {
            path:'orderOverview',
            name:'orderOverview',
            label:'订单总览',
            component:orderOverview
          }
        ]
      },
      //房屋管理
      {
        path: "fwglview",
        name: "fwglview",
        component: FwglView,
        label: "房屋管理",
        //
        children: [
          {
            path: "hzglview",
            name: "hzglview",
            component: HzglView,
            label: "合租管理",
          },
          {
            path: "zzglview",
            name: "zzglview",
            label: "整租管理",
            component: ZzglView,
          },
        ]
      },
    ],
  },
    // 
  {
    path: "/about",
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (About.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import("../views/AboutView.vue"),
  },
// 登录页面路由
  {
    path: "/login",
    name: "login",
    component: () => import("../views/LoginView.vue"),
  },
];

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes,
});

export default router;
